<template>
<div class=''>
    <div ref="refdemo">domref</div>
    <input type="range" v-model="size">
</div>
</template>

<script>
import { ref, watch } from "vue"
export default {
setup(){
    // 定义空白ref作为template ref操作dom
    const refdemo = ref(null)
    const size = ref(24)
    // 监听拖动
    watch(size,() => {
        refdemo.value.style.fontSize = size.value + "px"
    })
    return{
        refdemo,
        size
    }
}
}
</script>
<style>

</style>